home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#46 (Jul 89)
/
XCMD Source
/
FileClose.c
next >
Wrap
Text File
|
1989-05-01
|
972b
|
44 lines
/********************************/
/* File: FileClose.c */
/* */
/* XCMD to access the file mgr */
/* call FSClose */
/* Paramters: */
/* param0 = file reference from */
/* the fileopen xcmd */
/* ---------------------------- */
/********************************/
#include <MacTypes.h>
#include <OSUtil.h>
#include <MemoryMgr.h>
#include <FileMgr.h>
#include <ResourceMgr.h>
#include <pascal.h>
#include <strings.h>
#include "HyperXCmd.h"
#include "HyperUtils.h"
pascal void main( paramPtr )
XCmdBlockPtr paramPtr;
{
short refnum;
char str[256];
/* convert the refnum to a usable form */
HLock( paramPtr->params[0] );
ZeroToPas( paramPtr, *(paramPtr->params[0]), &str );
HUnlock( paramPtr->params[0] );
refnum = (short)StrToNum( paramPtr, &str );
/* Normally we should check the result */
/* code but it won't kill us to ignore */
/* the reslt of a close file call */
if ( FSClose(refnum) )
;
paramPtr->returnValue = 0L;
}